﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using WebApiV3.Data;
using WebApiV3.Data.Helper;

namespace WebApiV3.Api.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private Admin10086525DbContext _db;

        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };

        private readonly ILogger<WeatherForecastController> _logger;

        public WeatherForecastController(ILogger<WeatherForecastController> logger,Admin10086525DbContext dbContext)
        {
            _logger = logger;
            _db = dbContext;
        }

        [HttpGet]
        public IEnumerable<string> Get()
        {
            throw new Exception("错误,errot desc");
        }
        //public string Get()
        //{
        //    throw new Exception("错误,errot desc");

        //    var lize = _db.Ranks.Include(x => x.Users).ToList();
        //    return JsonHelper.SerializeObject(lize);
        //}
    }
}
